package com.example.myapplication;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatTextView;

import com.example.myapplication.activity.TestBena;
import com.google.gson.Gson;

import java.util.ArrayList;

public class Note extends AppCompatActivity {


    private AppCompatTextView searchImageView;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        searchImageView.findViewById(R.id.searchImageView);


        searchImageView = searchImageView.findViewById(R.id.mainTextView);
        searchImageView.setOnClickListener(view1 -> {
            ArrayList<TestBena> arrayList = new ArrayList<TestBena>();
            TestBena testBena = new TestBena();
            testBena.setName("张三");
            testBena.setAge("18");
            testBena.setOther("12312313");
            testBena.setName("张三");
            testBena.setAge("18");
            testBena.setOther("12312313");
            testBena.setName("张三");
            testBena.setAge("18");
            testBena.setOther("12312313");
            testBena.setName("张三");
            testBena.setAge("18");
            testBena.setOther("12312313");
            arrayList.add(testBena);
            MyApp.get().getEditor().putString("test_data", new Gson().toJson(arrayList));
            MyApp.get().getEditor().apply();
        });

        recreate();
    }


}

